package aplicacion;

import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;

import web.Beans;
import web.HiberSpring;

public class Aplicacion extends WebApplication {

	@Override
	public Class<? extends Page> getHomePage() {
		return HiberSpring.class;
	}

	@Override
	protected void init() {
		super.init();
		inyectarSpring();
		montarPaginas();
	}

	private void montarPaginas() {
		mountPage("hiberSpring", HiberSpring.class);
		mountPage("springBean", Beans.class);
	}

	protected void inyectarSpring() {
		getComponentInstantiationListeners().add(
				new SpringComponentInjector(this));
	}
}